#ifndef __SLAVE_H__
#define __SLAVE_H__
class PacketDecoder;

typedef Int32 SlaveId;
struct PlayerId;
class Player;
#pragma pack(1)

class Slave
{
private:
	Slave();
public:
	Slave(SlaveId nSlaveId);
	virtual ~Slave();
	void SetSlaveId(SlaveId nSlaveId){m_nSlaveId = nSlaveId;}
	SlaveId GetSlaveId(){ return m_nSlaveId;}
	void SetSlaveInfo(SlaveInfo& info){m_stSlaveInfo = info;};
	SlaveInfo& GetSlaveInfo(){return m_stSlaveInfo;}

	void addSkill(Int32 csv_id);
	void removeSkill(Int32 csv_id);
	bool hasSkill(Int32 csv_id);
	Skill* getSkill(Int32 csv_id);
	void decodeSkills();
	void encodeSkills();
	void sendSkills(PacketEncoder &encoder);

	void SetWatch(bool bWatch){m_bWatch = bWatch;}
	bool GetWatch(){ return m_bWatch;}

	void SetOwnerPlayer(Player* pPlayer);
	Player* GetOwnerPlayer();
private:
	SlaveId					m_nSlaveId;
	SlaveInfo				m_stSlaveInfo;
	std::vector<SkillId>	m_arSkills;
	bool					m_bWatch;
	void*					m_pOwnerPlayer;
};
#pragma pack()
#endif